<?php
namespace catchAdmin\settlement\model\search;

trait InvoiceSearch
{
    public  function searchInvoiceNumAttr($query, $value, $data)
    {
        return $query->whereLike('invoice_num',$value);
    }
    public  function searchSettlementUnitAttr($query, $value, $data)
    {
        return $query->whereLike('settlement_unit',$value);
    }
    public  function searchInvoiceHeaderAttr($query, $value, $data)
    {
        return $query->whereLike('invoice_header',$value);
    }
    public  function searchTaxpayerAttr($query, $value, $data)
    {
        return $query->whereLike('taxpayer',$value);
    }
    public  function searchTelephoneAttr($query, $value, $data)
    {
        return $query->whereLike('telephone',$value);
    }
    public  function searchBankAttr($query, $value, $data)
    {
        return $query->whereLike('bank',$value);
    }
    public  function searchAccountAttr($query, $value, $data)
    {
        return $query->whereLike('account',$value);
    }
    public  function searchInvoicingCompanyAttr($query, $value, $data)
    {
        return $query->whereLike('invoicing_company',$value);
    }
    public  function searchCancelDateAttr($query, $value, $data)
    {
        return $query->where('cancel_date','between',[$value[0],$value[1]]);
    }
    public  function searchRmbXeStartAttr($query, $value, $data)
    {
        return $query->where('rmb_xe','>=',$value);
    }
    public  function searchRmbXeEndAttr($query, $value, $data)
    {
        return $query->where('rmb_xe','<=',$value);
    }
    public  function searchJobNumberAttr($query, $value, $data)
    {
        return $query->whereLike('job_number',$value);
    }
}